home *** CD-ROM | disk | FTP | other *** search
/ Champak 140 / (Vol 140) Sep 19 2011.iso / Games / top_that_pizza.swf / scripts / FLabelSymbol.as < prev    next >
Text File  |  2011-09-19  |  2KB  |  56 lines

  1. _global.FLabelClass = function()
  2. {
  3.    var _loc1_ = this;
  4.    if(_loc1_.hostComponent == undefined)
  5.    {
  6.       _loc1_.hostComponent = _loc1_._parent.controller != undefined ? _loc1_._parent.controller : _loc1_._parent;
  7.    }
  8.    if(_loc1_.customTextStyle == undefined)
  9.    {
  10.       if(_loc1_.hostComponent.textStyle == undefined)
  11.       {
  12.          _loc1_.hostComponent.textStyle = new TextFormat();
  13.       }
  14.       _loc1_.textStyle = _loc1_.hostComponent.textStyle;
  15.       _loc1_.enable = true;
  16.    }
  17. };
  18. FLabelClass.prototype = new MovieClip();
  19. Object.registerClass("FLabelSymbol",FLabelClass);
  20. FLabelClass.prototype.setLabel = function(label)
  21. {
  22.    var _loc1_ = this;
  23.    var _loc2_ = _loc1_.hostComponent.styleTable.embedFonts.value;
  24.    if(_loc2_ != undefined)
  25.    {
  26.       _loc1_.labelField.embedFonts = _loc2_;
  27.    }
  28.    _loc1_.labelField.setNewTextFormat(_loc1_.textStyle);
  29.    _loc1_.labelField.text = label;
  30.    _loc1_.labelField._height = _loc1_.labelField.textHeight + 2;
  31. };
  32. FLabelClass.prototype.setSize = function(width)
  33. {
  34.    this.labelField._width = width;
  35. };
  36. FLabelClass.prototype.setEnabled = function(enable)
  37. {
  38.    var _loc2_ = this;
  39.    var _loc3_ = enable;
  40.    _loc2_.enable = _loc3_;
  41.    var _loc1_ = _loc2_.hostComponent.styleTable[!_loc3_ ? "textDisabled" : "textColor"].value;
  42.    if(_loc1_ == undefined)
  43.    {
  44.       _loc1_ = !_loc3_ ? 8947848 : 0;
  45.    }
  46.    _loc2_.setColor(_loc1_);
  47. };
  48. FLabelClass.prototype.getLabel = function()
  49. {
  50.    return this.labelField.text;
  51. };
  52. FLabelClass.prototype.setColor = function(col)
  53. {
  54.    this.labelField.textColor = col;
  55. };
  56.